__all__ = ['DbEntity']
class DbEntity:

    def __init__(self, db):
        self.db = db

    def execute(self, queries, rows = None):
        for query in queries:
            if rows == None:
                self.db.executeonly(query)
            else:
#                print(query, list(rows)) #need debug logger of queries (and benchmarker)
                self.db.executemany(query, rows)


    def query(self, query, params = None):
            if params == None:
                return self.db.executeonly(query)
            else:
                return self.db.executeonly(query, params)
